/* 
 * Copyright (c) 2012 Christoph Mueller <ruunhb@googlemail.com>
 * 
 * Crystal is free software: you can redistribute it and/or modify
 * it under the terms of the Lesser GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Crystal is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * Lesser GNU General Public License for more details.
 *
 * You should have received a copy of the Lesser GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#ifndef LIQUID_STRUCTURES_MAP_H
#define LIQUID_STRUCTURES_MAP_H


#include "structures.h"

struct LqPair {
    const_pointer key;
    const_pointer data;
};

struct LqMap;

struct LqMap*       lq_map_new(lq_ordering_funptr compare);
void		    lq_map_free(struct LqMap* map);

size_t              lq_map_size(struct LqMap* map);

struct LqPair*	    lq_map_pairs(struct LqMap* map);

pointer             lq_map_lookup(struct LqMap* map, const_pointer key);
int                 lq_map_insert(struct LqMap* map, const_pointer key, const_pointer value);
struct LqPair       lq_map_remove(struct LqMap* map, const_pointer key);
void 		    lq_map_clear(struct LqMap* map, lq_free_funptr fun_key, lq_free_funptr fun_data);



#endif // LIQUID_STRUCTURES_MAP_H
